package Summative;

import javax.swing.*;
import java.awt.*;
import java.util.*;

public class ViewPanel extends JPanel
{
  
  int x;
  int y;
  int eX;
  int eY;
  VectorList list;
  
  public ViewPanel()
  {
    super();
    setSize(500, 500);
  }
  
  public void setVectorList(VectorList vectors)
  {
    this.list = vectors;
  }
  
  public void paintComponent(Graphics g)
  {
    for(Vector vector: list.getArray())
    { 
      g.drawLine(vector.getDrawCoordX(), vector.getDrawCoordY(), vector.getDrawCoordXF(), vector.getDrawCoordYF());
    } 
  }
  
  public void update()
  {
    repaint();
  }
}